<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditStaffTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditStaffLabel_staffId}" for="staffId" />
                    <h:inputText id="staffId" value="#{staffController.selected.staffId}" title="#{bundle.EditStaffTitle_staffId}" required="true" requiredMessage="#{bundle.EditStaffRequiredMessage_staffId}"/>
                    <h:outputLabel value="#{bundle.EditStaffLabel_type}" for="type" />
                    <h:inputText id="type" value="#{staffController.selected.type}" title="#{bundle.EditStaffTitle_type}" required="true" requiredMessage="#{bundle.EditStaffRequiredMessage_type}"/>
                    <h:outputLabel value="#{bundle.EditStaffLabel_userName}" for="userName" />
                    <h:inputText id="userName" value="#{staffController.selected.userName}" title="#{bundle.EditStaffTitle_userName}" required="true" requiredMessage="#{bundle.EditStaffRequiredMessage_userName}"/>
                    <h:outputLabel value="#{bundle.EditStaffLabel_password}" for="password" />
                    <h:inputText id="password" value="#{staffController.selected.password}" title="#{bundle.EditStaffTitle_password}" required="true" requiredMessage="#{bundle.EditStaffRequiredMessage_password}"/>
                    <h:outputLabel value="#{bundle.EditStaffLabel_fullName}" for="fullName" />
                    <h:inputText id="fullName" value="#{staffController.selected.fullName}" title="#{bundle.EditStaffTitle_fullName}" />
                    <h:outputLabel value="#{bundle.EditStaffLabel_address}" for="address" />
                    <h:inputText id="address" value="#{staffController.selected.address}" title="#{bundle.EditStaffTitle_address}" />
                    <h:outputLabel value="#{bundle.EditStaffLabel_dateOfBirth}" for="dateOfBirth" />
                    <h:inputText id="dateOfBirth" value="#{staffController.selected.dateOfBirth}" title="#{bundle.EditStaffTitle_dateOfBirth}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditStaffLabel_gender}" for="gender" />
                    <h:inputText id="gender" value="#{staffController.selected.gender}" title="#{bundle.EditStaffTitle_gender}" />
                    <h:outputLabel value="#{bundle.EditStaffLabel_email}" for="email" />
                    <h:inputText id="email" value="#{staffController.selected.email}" title="#{bundle.EditStaffTitle_email}" />
                    <h:outputLabel value="#{bundle.EditStaffLabel_phone}" for="phone" />
                    <h:inputText id="phone" value="#{staffController.selected.phone}" title="#{bundle.EditStaffTitle_phone}" />
                </h:panelGrid>
                <h:commandLink action="#{staffController.update}" value="#{bundle.EditStaffSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditStaffViewLink}"/>
                <br />
                <h:commandLink action="#{staffController.prepareList}" value="#{bundle.EditStaffShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.EditStaffIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
